/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.object;

import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.EndGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.shapes.Rectangle;

/**
 *
 * @author Admin
 */
public class RectangleGenerator extends PolygonGenerator
{

    @Override
    public boolean canGenerate(Object c) {
        if(c instanceof Rectangle)
            return true;
        else return false;
    }

    @Override
    public void generateStart(StringBuilder sb){
        sb.append("SuperRect{\n");
    }

     @Override
    public void generateEnd(StringBuilder sb){
        EndGenerator.generateEnd(sb);
    }

    @Override
    public void generateUniqueAttributes(StringBuilder sb,Object o,int recursionLevel){
        Rectangle r = (Rectangle)o;
        sb.append("x:"+r.getHPos()+";\n");
        sb.append("y:"+r.getVPos()+";\n");
        sb.append("height:"+r.getSizeV()+";\n");
        sb.append("width:"+r.getSizeH()+";\n");
    }

}
